﻿Partial Public Class SaveFileDialog

    Public sel As String = Nothing

    Public Sub SetFileInfo(ByVal name As String, ByVal RTB As RichTextBox)
        Label1.Content = "Do you want to save " + name
        RichTextBox1.AppendText("")
    End Sub

#Region "Buttons"

    Private Sub YesButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles YesButton.Click
        sel = "Yes"
        Close()
    End Sub

    Private Sub NoButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles NoButton.Click
        sel = "No"
        Close()
    End Sub

    Private Sub CancelButton_Click(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles CancelButton.Click
        sel = Nothing
        Close()
    End Sub

#End Region

    Private Sub SaveFileDialog_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) _
    Handles Me.Loaded
        Dim fs As IO.FileStream = IO.File.OpenRead(My.Computer.FileSystem.SpecialDirectories.Temp + "\TVPre.rtf")
        Dim tr As New TextRange(RichTextBox1.Document.ContentStart, RichTextBox1.Document.ContentEnd)
        tr.Load(fs, Windows.DataFormats.Rtf)
        fs.Close()
        If MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnVista Or _
        MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnWin7 Then
            If My.Settings.Options_IsGlassOn Then
                GlassHelper.ExtendGlassFrame(Me, New Thickness(-1, -1, -1, -1))
            End If
        End If
    End Sub
End Class
